package com.jwong.test;

import io.fabric8.kubernetes.api.model.Event;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class EventsGetEquivalent {
  private static final Logger logger = LoggerFactory.getLogger(EventsGetEquivalent.class);

  public static void main(String[] args) {
    try (final KubernetesClient k8s = new DefaultKubernetesClient()) {
      k8s.v1().events().inNamespace("default").list().getItems().stream()
        .map(Event::getMessage)
        .forEach(logger::info);
    }
  }
}